#include <Starter.hpp>
#include <Misc/Config.hpp>


/* Function prototype */
void printHelp();



int main(int argc, char** argv){

	/* Init config to handle parameter */
	Config::instance()->parseArguments(argc,argv);

	if(Config::instance()->isHelpFlag()){
		printHelp();
		return 0;
	}else{
		Starter starter;
		return starter.start();

	}

}

void printHelp(){

	std::cout << "IBRC-P2P-client" << std::endl;
	std::cout << "Usage: ibrc_p2p_client [args]" << std::endl;
	std::cout << "Options:" << std::endl;
	std::cout << " -h --help\t\t\t\t Prints this help message." << std::endl;
	std::cout << " -n --name <CLIENTNAME>\t\t\t Initial name of the client" << std::endl;
	std::cout << " -pm --port-multicast <PORT>\t\t port for peer discovery multicast messages." << std::endl;
	std::cout << " -pu --port-unicast <PORT>\t\t port for peer discovery unicast messages." << std::endl;
	std::cout << " -ia --interface-address <ADDRESS>\t local sender IP-Address." << std::endl;
	std::cout << " -ma --multicast-address <ADDRESS>\t multicast address for peer discovery." << std::endl;
	std::cout << " -i --info-file <PATH>\t\t\t Path to the information file location." << std::endl;
	std::cout << " -r --raw-data-log-file <PATH>\t\t Path to the raw data log file location." << std::endl;
	std::cout << " -l --log-file <PATH>\t\t\t Path to the log file location." << std::endl;
	std::cout << " -p --peer-discovery-file <PATH>\t Path to the peer discovery file." << std::endl;
	std::cout << " --input-file <PATH>\t\t\t Path to the client input file." << std::endl;
	std::cout << " --output-file <PATH>\t\t\t Path to the client output file." << std::endl;
	std::cout << " --connection-number <NUMBER>\t\t Number of connection slots for client (default 3)" << std::endl;

}
